
const data_config = require("./data_config");


module.exports = {
  nav_name: '拼团管理',          //生成导航菜单
  module_name: 'groupWork_m',     //生成路径，必须与文件名相同
  //接口
  api: `{
      page: commonPath + "/admin/spell_product/page",              
      cancel: commonPath + '/admin/spell_product/cancel',              
      add: commonPath + '/admin/spell_product/add',                 
  }`, 
  //列表
  table: {
    //isGenerate: "false",                    //false表示不生成页面
    table_name: "groupWork_m_table",        //表页面名
    nav_name: "拼团列表",                  //导航名
    tipsText: "拼团管理 >> 拼团列表",    //顶部文字
    // tableReqMethod: "get",  //分页请求配置成get方式, 默认为post
    // pageApi: "API.sys_setting.sys_setting_page",  //请求api
    // extraPageRequestParams: `
    //   courseId: this.$route.query.id,  //请求
    // `, //已有page和pageSize
    //配置列表页面
    tableData: [
      //类型normal(title定义名称  name定义动态绑定值  type定义类型  itemWidth定义宽度)
      { title: '序号', name: 'index', type: "normal",itemWidth: "60" },
      { title: '编号', name: 'id', type: "normal" },
      { title: '商品名', name: 'name', type: "normal" },
      { title: '拼团金额', name: 'price', type: "normal" },
      { title: '参团人数', name: 'currentNumber', type: "normal" },
      //类型opts(showName定义动态绑定值  showObj定义匹配显示值)
      {
          title: '类型',
          name: 'spellState',
          type: "opts",
          showName: "spellStateShow",
          showObj: `{
            "0": "取消拼团",
            "1": "拼团中",
            "2": "拼团成功",
          }`
      },
      {
          title: '状态',
          name: 'state',
          type: "opts",
          showName: "stateShow",
          showObj: `{
            "0": "有效",
            "1": "无效",
          }`
      },
      { title: '开团时间', name: 'startDate', type: "normal" },
      
    ],

    //配置列表操作项(type类型  text名称  request是否请求  jump跳转路由【本文件名+跳转文件名】 url接口 requestType请求方式)
    tableOpt: [
        //下架功能
        {
          type: "del",
          text: "下架",
          request: true,
          url: "API.groupWork_m.cancel",
          requestType: 'get',
          // isSplitSearchString: 'true',  //拼接查询字符串（post需要，get不需要）。
        },
        //编辑跳转
        // {
        //   type: "modify",
        //   text: "编辑",
        //   request: false,                
        //   jump: "/groupWork_m_add_groupWork"
        // },
        
    ],
     
    //配置搜索栏
    search: {
        //筛选
        contentArr: {
            //labelName定义名称  inputName定义动态绑定值
            input1: { labelName: '商品编号', inputName: 'id',labelWidth:'150'},
            //selectOptsName自定义名称  selectOptsArr下拉内容  labelWidth定义宽度
            select1: {
                labelName: '拼团金额',
                inputName: 'price',
                selectOptsName: "priceOpts",
                selectOptsArr: `[
                  { value: "", label: "全部" },
                  { value: "100", label: "100" },
                  { value: "200", label: "200" },
                  { value: "300", label: "300" },
                  { value: "400", label: "400" },
                  { value: "500", label: "500" },
                ],
                `, 
            },
            select2: {
                // labelWidth: "120",
                labelName: '拼团状态',
                inputName: 'spellState', 
                selectOptsName: "spellStateOpts",
                selectOptsArr: `[
                    { value: "", label: "全部" },
                    { value: "0", label: "取消拼团" },
                    { value: "1", label: "拼团中" },
                    { value: "2", label: "拼团成功" },
                ],
                `, 
            },
            
        },
        //查找按钮的文字
        searchBtn: {
            //链接与table请求接口相同，不做另外配置
            text: "查询",   
        },
        //添加按钮
        addBtn: {
            //(type类型  text名称  request是否请求  jump跳转路由【本文件名+跳转文件名】)
            type: "add",
            text: "发布",
            request: false,
            jump: "/groupWork_m_add_groupWork", 
        }
    },
  },


  //添加页面
  add_page: {
    //isGenerate: "false",                     //false表示不生成页面
    add_page_name: "add_groupWork",          //尽量短些,要拼接路由
    tipsText: "拼团管理 >> 发布拼团",
    // pageApi: "API.sys_setting.sys_setting_page",  //请求api
    formData: {
        //titleText: "请填写商品信息",
        //(labelName定义名称  inputName定义绑定值 isNeed定义是否允许为空 disabled定义是否禁用 selectOptsName自定义名称 selectOptsArr定义下拉内容)
        input1: {
            labelName: '商品编码',
            inputName: 'firstKinds',
            isNeed: 'true',
            //disabled: 'true', 
        },
        input2: {
            labelName: '商品名称',
            inputName: 'name',
            isNeed: 'true',
            //disabled: 'true', 
        },
         //图片上传(type为many时可多张/single只能一张 countLimit定义图片张数  uploadMethod定义方法)
         uploadImg1: {
            labelName: "商品主图",
            inputName: "mainImgUrl",
            type: "many",              
            countLimit: "1",
            uploadMethod: "handleUpload1",
            isNeed: 'true',
        },
        //富文本组件 富文本组件添加默认背景
        richText1: {
            labelName: '商品详情',
            inputName: 'details',
            isNeed: 'true',
            minHeight: "180", //高度
            uploadApi: "API.common.upload",
            editContentChangeMethodName: "handleBgEditChange", //改变方法
            isNeed: 'true',
        },
        input3: {
            labelName: '拼团金额',
            inputName: 'price',
            isNeed: 'true',
            //disabled: 'true', 
        },
        input4: {
            labelName: '发团数量',
            inputName: 'num',
            isNeed: 'true',
            //disabled: 'true', 
        },
        
    },
    addBtn: {
        //(text名称  url接口  extraParams请求的额外参数  extraQueryParams跳转时携带参数)
        text: '立即发布',
        url: "API.groupWork_m.add",
        // extraParams: ` courseId: Number(this.$route.query.courseId), `,
        jumpPath: "/groupWork_m_groupWork_m_table",
        // extraQueryParams: ` { id: this.$route.query.courseId } `,      
    }, 
    editBtn: {
        text: '编辑',
        detailUrl: "API.groupWork_m.detail",              //默认get方式请求
        // detailType: 'get',                             //请求方式
        isSplitSearchString: 'true',                      //拼接查询字符串, get和post的必须字段
        // extraParams: ` courseId: Number(this.$route.query.courseId), `, //请求的额外参数
        editUrl: "API.groupWork_m.edit",
        jump: '/groupWork_m_groupWork_m_table'
    },
    cancelBtn: { text: "取消" }, 



  },


}

